import sys
import pygame
from settings import Settings
from ship import Ship


def run_game():

	'''初始化窗口'''
	pygame.init()
	ai_settings = Settings()
	screen = pygame.display.set_mode((ai_settings.screen_width, ai_settings.screen_width))
	pygame.display.set_caption("外星人大战")

	'''创建飞船'''
	ship = Ship(screen)

	while True:
		'''键盘监测'''
		for event in pygame.event.get():
			if event.type == pygame.QUIT:
				sys.exit()

		'''绘制屏幕背景 飞船'''
		screen.fill(ai_settings.bg_color)
		ship.blitme()

		'''让最近绘制的屏幕可见'''
		pygame.display.flip()


run_game()
